//package com.sloan.community.filter;
//
//import org.springframework.util.AntPathMatcher;
//import reactor.core.publisher.Flux;
//import reactor.core.publisher.Mono;
//
//public class AntPathMatcherExample {
//    public static void main01(String[] args) {
//        AntPathMatcher pathMatcher = new AntPathMatcher();
//
//        // 单个路径匹配
//        String pattern = "/api/**";
//        String path = "/api/users";
//        boolean isMatch = pathMatcher.match(pattern, path);
//        System.out.println("Path Match: " + isMatch); // 输出: true
//
//        // 提取路径变量
//        pattern = "/api/{id}";
//        path = "/api/123";
//        System.out.println(pathMatcher.match(pattern, path));
//        String extractedVariable = pathMatcher.extractUriTemplateVariables(pattern, path).get("id");
//        System.out.println("Extracted Variable: " + extractedVariable); // 输出: 123
//    }
//
//    public static void main(String[] args) {
//        Flux<String> sourceFlux = Flux.empty();
//        Flux<String> fallbackFlux = Flux.just("Fallback Value");
//
//        Flux<String> resultFlux = sourceFlux.switchIfEmpty(Mono.error(new RuntimeException("Fallback Exception")));
//
//        resultFlux.subscribe(System.out::println);
//    }
//}
